package com.hc.sp04.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import sp01.pojo.User;
import sp01.util.JsonResult;

/**
 * @author Z
 * @DATE 2021/8/31 14:14
 * @e-mail ...@qq.com
 */
@FeignClient("user-service")
public interface UserClient {
//    获取用户
    @GetMapping("/{userId}")
    JsonResult<User> getUser(@PathVariable Integer userId);

//    增加用户积分
    @GetMapping("/{userId}/score")
    JsonResult<?> addScore(@PathVariable Integer userId, @RequestParam("score") Integer score);
}
